<template>
  <div class="aaaaaa1">城市列表
    <van-index-bar>
      <van-index-anchor v-for="(item,index) in city" :key="index" :index='item.initial'>
        {{item.initial}}
        <van-cell v-for="(i,key) in item.list" :key="key" :title="i.name" />
      </van-index-anchor>

    </van-index-bar>
  </div>
</template>

<script>
import axios from 'axios';
export default {
    name:'Citylist',
    data:function(){
      return{
        city:[],
      };
    },
    created(){
      axios.get('/json/city.json').then((res)=>{
        console.log(res);
        this.city=res.data.city
      })
    }
}
</script>

<style>
.aaaaaa1{
  text-align: left;
}
.van-index-bar__index {
    padding: 0 8px 0 16px;
    font-weight: 500;
    font-size: 10px;
    line-height: 14px;
    margin-top: 10px;
}

</style>